<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>课程编辑</title>
<script type="text/javascript">
	function fh() {
		window.location="course";
	}
</script>

<script type="text/javascript">
	function jy(form) {
		var name=form.name.value;
		var classHour=form.classHour.value;
		if(name.length==0){
			alert("请输入课程名！");
			return false;
		}
		if(classHour.length==0){
			alert("请输入课时数！");
			return false;
		}
		if(!(/^[1-9]\d*$/.test(classHour))){
			alert("请输入正整数");
			return false;
		}
		return true;
	}
</script>
<style type="text/css">
	.sss{
		border: 2px solid #99CCFF;
		border-radius:15px;
		padding-bottom: 15px;
		padding-left: 10px;
		padding-right: 10px;
		width:240px;
	}
	form p label{
		display:inline-block;
		width:80px;
		text-align: right;
	}
	
	input{
		padding: 6px;
	}
	
	form button{
		float:right;
	}
	
	button{
		border: 1px solid #99CCFF;
		width:60px;
		margin-left:2px;
		margin-bottom: 3px;
		border-radius:4px;
		}
</style>
</head>
<body>
	<div class="sss">
	<form action="course?method=save" method="post"  onsubmit="return jy(this)" >
	<input type="hidden" name="id" value="${model.id}">
	<p><label>课程名称：</label><input type="text" name="name" value="${model.name}"></p>
	<p><label>课时数：</label><input type="text" name="classHour" value="${model.classHour}"></p>
	<p> <button type="reset">重置</button> <button type="submit">提交</button></p>
	</form>
	<button onclick="fh()">返回</button>
	</div>
</body>
</html>